import 'package:flutter/material.dart';

// 自定义所有可滚动组件的滚动行为
class CusScrollBehavior extends StatelessWidget {
  final Widget child;
  const CusScrollBehavior({super.key, required this.child});

  @override
  Widget build(BuildContext context) {
    return ScrollConfiguration(behavior: CustomScrollBehavior(), child: child);
  }
}

// ScrollBehavior配置滚动对象，重写buildOverscrollIndicator方法
class CustomScrollBehavior extends ScrollBehavior {
  @override
  Widget buildOverscrollIndicator(
      BuildContext context, Widget child, ScrollableDetails details) {
    // 返回原始的child即可取消，除了滚动外的任何效果（比如回弹，波浪等）
    return child;
  }
}
